package com.xpsoft.oa.dao.produce.impl;


import java.util.List;

import org.hibernate.Query;

import com.xpsoft.core.dao.impl.BaseDaoImpl;
import com.xpsoft.oa.dao.produce.MaterialPurRealInfoDao;
import com.xpsoft.oa.model.produce.MaterialPurRealInfo;

public class MaterialPurRealInfoDaoImpl extends BaseDaoImpl<MaterialPurRealInfo> implements MaterialPurRealInfoDao{

	public MaterialPurRealInfoDaoImpl() {
		super(MaterialPurRealInfo.class);
	}

	@Override
	public void deleteMaterialPurRealInfos(Long purRealId, List<Long> idList) {
		// TODO Auto-generated method stub
		String hql = "delete from MaterialPurRealInfo where id not in (:ids) and materialPurReal.id=:purRealId";
		Query query =  getSession().createQuery(hql);
		query.setParameterList("ids", idList).setParameter("purRealId", purRealId);
		query.executeUpdate();
	}

}